package com.example.provider;

import com.example.common.service.UserService;
import com.example.easyrpc.RpcApplication;
import com.example.easyrpc.register.LocalRegister;
import com.example.easyrpc.server.HttpServer;
import com.example.easyrpc.server.impl.VertxHttpServer;

public class ProviderExample {

    public static void main(String[] args) {
        //RPC框架初始化
        RpcApplication.init();

        //注册服务
        LocalRegister.register(UserService.class.getName(), UserServiceImpl.class);

        HttpServer httpServer = new VertxHttpServer();
        //通过配置文件application.properties配置web服务的端口
        httpServer.doStart(RpcApplication.getRpcConfig().getServerPort());
    }
}
